<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\captcha\Captcha;
/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */

$this->title = Yii::t('app', 'Login');
$this->params['breadcrumbs'][] = $this->title;

$fieldOptions1 = [
    'options' => ['class' => 'form-group has-feedback'],
    'inputTemplate' => "{input}<span class='glyphicon glyphicon-envelope form-control-feedback'></span>"
];

$fieldOptions2 = [
    'options' => ['class' => 'form-group has-feedback'],
    'inputTemplate' => "{input}<span class='glyphicon glyphicon-lock form-control-feedback'></span>"
];
?>

<div id="header">
            <div class="hd">
                  <div class="left">
                      <a class="logo" href="#"><img src="<?=Yii::$app->params['img']?>logo.png"></a>
                      <a class="dl" href="#">登录</a>
                  </div>
                  
                  <ul class="nav">
                      <li><a href="http://xh.zhongkefu.com.cn">返回首页</a></li>
                      <li><a href="http://www.zhongkefu.com.cn">中科服官网</a></li>
                      <li><a href="http://wx.zhongkefu.com.cn">微信官网</a></li>
                      <li><a href="http://www.zhongkefu.com.cn">微酒店</a></li>
                      <li><a href="http://www.zhongkefu.com.cn">微外卖</a></li>
                      <li><a href="http://www.zhongkefu.com.cn">帮助</a></li>
                      <li><a href="http://www.zhongkefu.com.cn">常见问题</a></li>
                  </ul>
                  <span id="Nav-btn" class="nnav" style="display:none;"><img src="<?=Yii::$app->params['img']?>menu.jpg"></span>
             </div>
</div>
        
        
<div id="Nav" style="display:none">
           <ul>
              <li><a href="http://xh.zhongkefu.com.cn">返回首页</a></li>
              <li><a href="http://www.zhongkefu.com.cn">中科服官网</a></li>
              <li><a href="http://wx.zhongkefu.com.cn">微信官网</a></li>
              <li><a href="http://www.zhongkefu.com.cn">微酒店</a></li>
              <li><a href="http://www.zhongkefu.com.cn">微外卖</a></li>
              <li><a href="http://www.zhongkefu.com.cn">帮助</a></li>
              <li><a href="http://www.zhongkefu.com.cn">常见问题</a></li>
           </ul>
</div>
      <div id="shade"></div>

<div class="banner">
             <div class="box">
                  <div class="de">
                      <?php $form = ActiveForm::begin(['id' => 'login-form', 'enableClientValidation' => false]); ?>
                      <div class="all_put">
                      <?= $form
                          ->field($model, 'username', $fieldOptions1)
                          ->label(false)
                          ->textInput(['placeholder' => $model->getAttributeLabel('username'),'class'=>'a','placeholder'=>'请输入用户名','id'=>'user']) ?>
                      </div>
                      <div class="all_put">
                          <?= $form
                              ->field($model, 'password', $fieldOptions2)
                              ->label(false)
                              ->passwordInput(['placeholder' => $model->getAttributeLabel('password'),'class'=>'b','placeholder'=>'请输入密码','id'=>'pass' ]) ?>
                      </div>

                      <?php if($yanzhengma){ ?>
                      <div class="all_put">
                          <?= $form->field($model, 'verifyCode', [
                              'options' => ['class' => 'form-group form-group-lg'],
                          ])->widget(Captcha::className(),[
                              'options' => ['maxlength' => 4,'class'=>'yz', 'placeholder' => '请输入验证码'],
                              'template' => "{input} {image}",
                              'imageOptions' => ['alt' => '验证码','id' => 'login_code','class'=>'yan', 'src' => '', 'data-api' =>  'site/captcha'  ]]); ?>
                          <div style="clear:both"></div>
                          </div>
                      <?php }?>



                      <div class="all_put">
                          <?= Html::submitInput(Yii::t('app', 'Login'), ['class' => 'del', 'name' => 'login-button','id'=>'sub']) ?>
                      </div>

                      <div class="mi" >
                          <div class="checkbox">
                              <label for="loginform-rememberme">
                                  <input name="LoginForm[rememberMe]" value="0" type="hidden"><input id="loginform-rememberme" name="LoginForm[rememberMe]" value="1" checked="" type="checkbox">
                                  <font>自动登录</font>
                              </label>
                              <p class="help-block help-block-error"></p>
                          </div>

                      </div>
                      <div class="im" style="padding-top:20px;"><img src="<?=Yii::$app->params['img']?>d_img.jpg"></div>
                      <?php ActiveForm::end(); ?>
                  </div>
             </div>
</div>
        
		<div id="footer">
             <div class="f_box">
                  <a href="#" class="logo"><img src="<?=Yii::$app->params['img']?>logo.png"></a>
                  <div class="zhong">
                      <ul><li><a href="http://www.zhongkefu.com.cn">关于我们</a></li><li>|</li><li><a href="http://www.zhongkefu.com.cn">咨询中心</a></li><li>|</li><li><a href="http://www.zhongkefu.com.cn">案例展示</a></li><li>|</li><li><a href="http://www.zhongkefu.com.cn">联系我们</a></li></ul>
                      <p>ICP备案编号：京ICP备10212988号  备案编号：京公网安备11010702001307  版权所有 北京中科服科技有限公司</p>
                  </div>
                  <div class="kexin"><img src="<?=Yii::$app->params['img']?>kexin.jpg"></div>
             </div>
        </div>
<script>
$(document).ready(function(e) {
    $("#sub").click(function(){
		var user=$("#user").val();
		var pass=$("#pass").val();
		if(user==""){
			alert("请填写正确的用户名！");
			return false;
			}
		if(pass==""){
			alert("请填写正确的密码！")
			return false;
			}

		})
});
</script>
<script>
    $ (document).ready (function ()
    {
        $ ("#Nav").hide ();
        $ ("#shade").hide ();
        $ ("#Nav-btn").click (function ()
        {   $("body").css("height","100%");
            $("html").css("height","100%");
            $ ("#Nav").toggle (500).css({"right":"0"});
            $ ("#shade").toggle (500).css({"left":"0"});
            $("body").css("overflow","hidden");
        });
        $("#shade").click(function()
        {
            $ ('#Nav').hide (500);
            $ ('#shade').hide (500);
            $("body").css("height","auto");
            $("html").css("height","auto");
        })
    })
</script>

<script>
$(document).ready(function(e) {
    $("#user").focus(function(){
		$("#user").addClass("d")
		})


	$("#pass").focus(function(){
		$("#pass").addClass("e")
		})
});
</script>

